package com.jackaltsc.mydemocustomview.main;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.jackaltsc.mydemocustomview.R;
import com.jackaltsc.mydemocustomview.activity.FlowActivity;
import com.jackaltsc.mydemocustomview.activity.TestActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btnTest, btnTest2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
    }

    private void initView() {

        btnTest = (Button) findViewById(R.id.btn_test);
        btnTest2 = (Button) findViewById(R.id.btn_test2);
        btnTest.setOnClickListener(this);
        btnTest2.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {

        switch (view.getId()) {

            case R.id.btn_test:
                startActivity(new Intent(this, TestActivity.class));
                break;

            case R.id.btn_test2:
                startActivity(new Intent(this, FlowActivity.class));
                break;
        }
    }
}
